package fractal.fractal;

public class SecondOddFractal extends Fractal
{
	@Override
	public int calculateN(double x, double y, int maxN, double R)
	{
		double d = 0, re = 0, im = 0;
		int N;
		for (N = 0; N < maxN && d <= R; N++)
		{
			re = re * re - im + x;
			im = 2 * re * im + y;
			d = re * re + im * im;
		}
		return N;
	}

	@Override
	public void initialise()
	{
		maxN = 300;
		xmin = -1.9;
		ymin = -1.1;
		dxy = 3.0 / width;
		R = 8;
		setAngle(0);
		setSff(1);
	}
}
